<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
  <meta name="description" content="API docs for the LoginService class from the nim_core_v2 library, for the Dart programming language.">
  <title>LoginService class - nim_core_v2 library - Dart API</title>


  
  <link rel="preconnect" href="https://fonts.gstatic.com">
  <link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" rel="stylesheet">
  
  <link rel="stylesheet" href="../static-assets/github.css?v1">
  <link rel="stylesheet" href="../static-assets/styles.css?v1">
  <link rel="icon" href="../static-assets/favicon.png?v1">
  
</head>

<body data-base-href="../" data-using-base-href="false" class="light-theme">
<div id="overlay-under-drawer"></div>
<header id="title">
  <span id="sidenav-left-toggle" class="material-symbols-outlined" role="button" tabindex="0">menu</span>
  <ol class="breadcrumbs gt-separated dark hidden-xs">
    <li><a href="../index.html">nim_core_v2</a></li>
    <li><a href="../nim_core_v2/nim_core_v2-library.html">nim_core.dart</a></li>
    <li class="self-crumb">LoginService class</li>
  </ol>
  <div class="self-name">LoginService</div>
  <form class="search navbar-right" role="search">
    <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
  <div class="toggle" id="theme-button" title="Toggle brightness">
    <label for="theme">
      <input type="checkbox" id="theme" value="light-theme">
      <span id="dark-theme-button" class="material-symbols-outlined">
        dark_mode
      </span>
      <span id="light-theme-button" class="material-symbols-outlined">
        light_mode
      </span>
    </label>
  </div>
</header>
<main>
<div
    id="dartdoc-main-content"
    class="main-content"
    data-above-sidebar="nim_core_v2&#47;nim_core_v2-library-sidebar.html"
    data-below-sidebar="nim_core_v2&#47;LoginService-class-sidebar.html">
    <div>
<h1><span class="kind-class">LoginService</span> class 
 
</h1></div>

    
<section class="desc markdown">
  <p>登录服务</p>
</section>


    <section>
      <dl class="dl-horizontal">
        

        
        


        
        
  <dt>Annotations</dt>
  <dd>
    <ul class="annotation-list clazz-relationships">
        <li>@HawkEntryPoint()</li>
    </ul>
  </dd>


      </dl>
    </section>

    
  <section class="summary offset-anchor" id="constructors">
    <h2>Constructors</h2>
    <dl class="constructor-summary-list">
        <dt id="LoginService" class="callable">
          <span class="name"><a href="../nim_core_v2/LoginService/LoginService.html">LoginService</a></span><span class="signature">()</span>
        </dt>
        <dd>
          
            <div class="constructor-modifier features">factory</div>
        </dd>
    </dl>
  </section>
    
  <section
      class="summary offset-anchor"
      id="instance-properties">
    <h2>Properties</h2>
    <dl class="properties">
        <dt id="hashCode" class="property inherited">
  <span class="name"><a href="https://api.flutter.dev/flutter/dart-core/Object/hashCode.html">hashCode</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/int-class.html">int</a></span>
  

</dt>
<dd class="inherited">
  The hash code for this object.
  <div class="features"><span class="feature">no setter</span><span class="feature">inherited</span></div>

</dd>

        <dt id="loginExtensionProvider" class="property">
  <span class="name"><a href="../nim_core_v2/LoginService/loginExtensionProvider.html">loginExtensionProvider</a></span>
  <span class="signature">&#8596; dynamic</span>
  

</dt>
<dd>
  提供登录扩展信息
  <div class="features"><span class="feature">getter/setter pair</span></div>

</dd>

        <dt id="onConnectFailed" class="property">
  <span class="name"><a href="../nim_core_v2/LoginService/onConnectFailed.html">onConnectFailed</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Stream-class.html">Stream</a><span class="signature">&lt;<wbr><span class="type-parameter">NIMError</span>&gt;</span></span>
  

</dt>
<dd>
  链接失败
  <div class="features"><span class="feature">no setter</span></div>

</dd>

        <dt id="onConnectStatus" class="property">
  <span class="name"><a href="../nim_core_v2/LoginService/onConnectStatus.html">onConnectStatus</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Stream-class.html">Stream</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMConnectStatus.html">NIMConnectStatus</a></span>&gt;</span></span>
  

</dt>
<dd>
  连接状态变更
  <div class="features"><span class="feature">no setter</span></div>

</dd>

        <dt id="onDataSync" class="property">
  <span class="name"><a href="../nim_core_v2/LoginService/onDataSync.html">onDataSync</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Stream-class.html">Stream</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMDataSyncDetail-class.html">NIMDataSyncDetail</a></span>&gt;</span></span>
  

</dt>
<dd>
  数据同步
  <div class="features"><span class="feature">no setter</span></div>

</dd>

        <dt id="onDisconnected" class="property">
  <span class="name"><a href="../nim_core_v2/LoginService/onDisconnected.html">onDisconnected</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Stream-class.html">Stream</a><span class="signature">&lt;<wbr><span class="type-parameter">NIMError</span>&gt;</span></span>
  

</dt>
<dd>
  链接断开
  <div class="features"><span class="feature">no setter</span></div>

</dd>

        <dt id="onKickedOffline" class="property">
  <span class="name"><a href="../nim_core_v2/LoginService/onKickedOffline.html">onKickedOffline</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Stream-class.html">Stream</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMKickedOfflineDetail-class.html">NIMKickedOfflineDetail</a></span>&gt;</span></span>
  

</dt>
<dd>
  被踢下线
  <div class="features"><span class="feature">no setter</span></div>

</dd>

        <dt id="onLoginClientChanged" class="property">
  <span class="name"><a href="../nim_core_v2/LoginService/onLoginClientChanged.html">onLoginClientChanged</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Stream-class.html">Stream</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMLoginClientChangeEvent-class.html">NIMLoginClientChangeEvent</a></span>&gt;</span></span>
  

</dt>
<dd>
  登录客户端列表变更
  <div class="features"><span class="feature">no setter</span></div>

</dd>

        <dt id="onLoginFailed" class="property">
  <span class="name"><a href="../nim_core_v2/LoginService/onLoginFailed.html">onLoginFailed</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Stream-class.html">Stream</a><span class="signature">&lt;<wbr><span class="type-parameter">NIMError</span>&gt;</span></span>
  

</dt>
<dd>
  登录失败
  <div class="features"><span class="feature">no setter</span></div>

</dd>

        <dt id="onLoginStatus" class="property">
  <span class="name"><a href="../nim_core_v2/LoginService/onLoginStatus.html">onLoginStatus</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Stream-class.html">Stream</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMLoginStatus.html">NIMLoginStatus</a></span>&gt;</span></span>
  

</dt>
<dd>
  登录状态变更事件
  <div class="features"><span class="feature">no setter</span></div>

</dd>

        <dt id="reconnectDelayProvider" class="property">
  <span class="name"><a href="../nim_core_v2/LoginService/reconnectDelayProvider.html">reconnectDelayProvider</a></span>
  <span class="signature">&#8594; dynamic</span>
  

</dt>
<dd>
  重连延时回调
在<a href="../nim_core_v2/LoginService/setReconnectDelayProvider.html">setReconnectDelayProvider</a> 中设置
  <div class="features"><span class="feature">no setter</span></div>

</dd>

        <dt id="runtimeType" class="property inherited">
  <span class="name"><a href="https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html">runtimeType</a></span>
  <span class="signature">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Type-class.html">Type</a></span>
  

</dt>
<dd class="inherited">
  A representation of the runtime type of the object.
  <div class="features"><span class="feature">no setter</span><span class="feature">inherited</span></div>

</dd>

        <dt id="tokenProvider" class="property">
  <span class="name"><a href="../nim_core_v2/LoginService/tokenProvider.html">tokenProvider</a></span>
  <span class="signature">&#8596; dynamic</span>
  

</dt>
<dd>
  获取动态登录token提供者
  <div class="features"><span class="feature">getter/setter pair</span></div>

</dd>

    </dl>
  </section>

    
  <section
      class="summary offset-anchor"
      id="instance-methods">
    <h2>Methods</h2>
    <dl class="callables">
        <dt id="getChatroomLinkAddress" class="callable">
  <span class="name"><a href="../nim_core_v2/LoginService/getChatroomLinkAddress.html">getChatroomLinkAddress</a></span><span class="signature">(<wbr><span class="parameter" id="getChatroomLinkAddress-param-roomId"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span> <span class="parameter-name">roomId</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="https://api.flutter.dev/flutter/dart-core/List-class.html">List</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span>&gt;</span>?</span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  获取聊天室link地址
需要IM处于登录状态
  

</dd>

        <dt id="getConnectStatus" class="callable">
  <span class="name"><a href="../nim_core_v2/LoginService/getConnectStatus.html">getConnectStatus</a></span><span class="signature">(<wbr>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMConnectStatus.html">NIMConnectStatus</a></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  获取连接状态
返回当前连接状态
  

</dd>

        <dt id="getCurrentLoginClient" class="callable">
  <span class="name"><a href="../nim_core_v2/LoginService/getCurrentLoginClient.html">getCurrentLoginClient</a></span><span class="signature">(<wbr>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMLoginClient-class.html">NIMLoginClient</a></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  获取当前登录终端相关信息， 在登录成功后才能获取，否则内容为空
  

</dd>

        <dt id="getDataSync" class="callable">
  <span class="name"><a href="../nim_core_v2/LoginService/getDataSync.html">getDataSync</a></span><span class="signature">(<wbr>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="https://api.flutter.dev/flutter/dart-core/List-class.html">List</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMDataSyncDetail-class.html">NIMDataSyncDetail</a></span>&gt;</span></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  获取当前数据同步项
返回当前数据同步项
  

</dd>

        <dt id="getKickedOfflineDetail" class="callable">
  <span class="name"><a href="../nim_core_v2/LoginService/getKickedOfflineDetail.html">getKickedOfflineDetail</a></span><span class="signature">(<wbr>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMKickedOfflineDetail-class.html">NIMKickedOfflineDetail</a>?</span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  获取被踢下线原因
返回被踢下线原因
  

</dd>

        <dt id="getLoginClients" class="callable">
  <span class="name"><a href="../nim_core_v2/LoginService/getLoginClients.html">getLoginClients</a></span><span class="signature">(<wbr>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="https://api.flutter.dev/flutter/dart-core/List-class.html">List</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMLoginClient-class.html">NIMLoginClient</a></span>&gt;</span></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  获取登录客户端列表
返回当前登录客户端列表
  

</dd>

        <dt id="getLoginStatus" class="callable">
  <span class="name"><a href="../nim_core_v2/LoginService/getLoginStatus.html">getLoginStatus</a></span><span class="signature">(<wbr>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMLoginStatus.html">NIMLoginStatus</a></span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  获取登录状态
返回当前登录状态
  

</dd>

        <dt id="getLoginUser" class="callable">
  <span class="name"><a href="../nim_core_v2/LoginService/getLoginUser.html">getLoginUser</a></span><span class="signature">(<wbr>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a>?</span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  获取当前登录用户
返回当前登录用户账号
  

</dd>

        <dt id="kickOffline" class="callable">
  <span class="name"><a href="../nim_core_v2/LoginService/kickOffline.html">kickOffline</a></span><span class="signature">(<wbr><span class="parameter" id="kickOffline-param-client"><span class="type-annotation"><a href="../nim_core_v2/NIMLoginClient-class.html">NIMLoginClient</a></span> <span class="parameter-name">client</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter">void</span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  踢掉登录客户端下线
  

</dd>

        <dt id="login" class="callable">
  <span class="name"><a href="../nim_core_v2/LoginService/login.html">login</a></span><span class="signature">(<wbr><span class="parameter" id="login-param-accountId"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span> <span class="parameter-name">accountId</span>, </span><span class="parameter" id="login-param-token"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span> <span class="parameter-name">token</span>, </span><span class="parameter" id="login-param-option"><span class="type-annotation"><a href="../nim_core_v2/NIMLoginOption-class.html">NIMLoginOption</a></span> <span class="parameter-name">option</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter">void</span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  登录
<code>accountId</code> 账号
<code>token</code> token
<code>option</code> 设置
  

</dd>

        <dt id="logout" class="callable">
  <span class="name"><a href="../nim_core_v2/LoginService/logout.html">logout</a></span><span class="signature">(<wbr>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter">void</span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  登出
  

</dd>

        <dt id="noSuchMethod" class="callable inherited">
  <span class="name"><a href="https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html">noSuchMethod</a></span><span class="signature">(<wbr><span class="parameter" id="noSuchMethod-param-invocation"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/Invocation-class.html">Invocation</a></span> <span class="parameter-name">invocation</span></span>)
    <span class="returntype parameter">&#8594; dynamic</span>
  </span>
  

</dt>
<dd class="inherited">
  Invoked when a nonexistent method or property is accessed.
  <div class="features"><span class="feature">inherited</span></div>

</dd>

        <dt id="setReconnectDelayProvider" class="callable">
  <span class="name"><a href="../nim_core_v2/LoginService/setReconnectDelayProvider.html">setReconnectDelayProvider</a></span><span class="signature">(<wbr><span class="parameter" id="setReconnectDelayProvider-param-provider"><span class="type-annotation">NIMReconnectDelayProvider?</span> <span class="parameter-name">provider</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="../nim_core_v2/NIMResult-class.html">NIMResult</a><span class="signature">&lt;<wbr><span class="type-parameter">void</span>&gt;</span></span>&gt;</span></span>
  </span>
  

</dt>
<dd>
  设置重连延时回调
调用此接口后再<a href="../nim_core_v2/LoginService/reconnectDelayProvider.html">reconnectDelayProvider</a>中处理回调
  

</dd>

        <dt id="toString" class="callable inherited">
  <span class="name"><a href="https://api.flutter.dev/flutter/dart-core/Object/toString.html">toString</a></span><span class="signature">(<wbr>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span>
  </span>
  

</dt>
<dd class="inherited">
  A string representation of this object.
  <div class="features"><span class="feature">inherited</span></div>

</dd>

    </dl>
  </section>
    
  <section
      class="summary offset-anchor inherited"
      id="operators">
    <h2>Operators</h2>
    <dl class="callables">
        <dt id="operator ==" class="callable inherited">
  <span class="name"><a href="https://api.flutter.dev/flutter/dart-core/Object/operator_equals.html">operator ==</a></span><span class="signature">(<wbr><span class="parameter" id="==-param-other"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/Object-class.html">Object</a></span> <span class="parameter-name">other</span></span>)
    <span class="returntype parameter">&#8594; <a href="https://api.flutter.dev/flutter/dart-core/bool-class.html">bool</a></span>
  </span>
  

</dt>
<dd class="inherited">
  The equality operator.
  <div class="features"><span class="feature">inherited</span></div>

</dd>

    </dl>
  </section>
    
    
    

  </div> <!-- /.main-content -->
  <div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
    <!-- The search input and breadcrumbs below are only responsively visible at low resolutions. -->
<header id="header-search-sidebar" class="hidden-l">
  <form class="search-sidebar" role="search">
    <input type="text" id="search-sidebar" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
</header>
<ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
    <li><a href="../index.html">nim_core_v2</a></li>
    <li><a href="../nim_core_v2/nim_core_v2-library.html">nim_core_v2</a></li>
    <li class="self-crumb">LoginService class</li>
</ol>

    <h5>nim_core_v2 library</h5>
    <div id="dartdoc-sidebar-left-content"></div>
  </div>
  <div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
  </div><!--/.sidebar-offcanvas-->
</main>
<footer>
  <span class="no-break">
    nim_core_v2
      10.9.2-ohos-beta
  </span>
  
</footer>


<script src="../static-assets/highlight.pack.js?v1"></script>
<script src="../static-assets/docs.dart.js"></script>

</body>
</html>

